<template>
  <div class="videoBox" :style="outModuleCss">
    <div :style="moduleBgCss" class="module-bg"></div>
    <div class="videoContent">
      <div class="title" v-if="propsData.params.useTitle == 1">
        <moduleHeader
          :propsData="propsData"
          :moduleName="propsData.params.text"
          @editModuleHeader="editModuleHeader"
        ></moduleHeader>
      </div>
      <div class="video">
        <video
          width="100%"
          height="100%"
          controls="controls"
          :poster="propsData.params.picUrl"
        >
          <source :src="propsData.params.videoUrl" />
          你的浏览器不支持HTML5视频。
        </video>
      </div>
    </div>
  </div>
</template>

<script>
import { mixinsModuleCss } from "@/components/DiyNew/diy/mixins/index.js";
import moduleHeader from "@/components/DiyNew/diy/baseControl/moduleHeader/index.vue";

export default {
  name: "diyVideo",
  props: {
    propsData: {
      type: Object,
      default: {},
    },
  },
  mixins: [mixinsModuleCss],
  components: {
    moduleHeader,
  },
  data() {
    return {};
  },
  mounted() {
    console.log(this.propsData, "video");
  },
  watch: {},
  computed: {},
  methods: {
    editModuleHeader(e) {
      this.$emit("chooseMoudle", e);
    }
  },
};
</script>

<style lang="scss" scoped>
.videoBox {
  width: 100%;
  position: relative;
  .videoContent {
    padding: 12px;
  }
  .module-bg {
    width: 100%;
    height: 100%;
    z-index: -1;
    position: absolute;
    left: 0;
    top: 0;
  }
  .title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  .video {
    width: 100%;
    height: 175px;
    border-radius: 5px;
    overflow: hidden;
  }
}
</style>
